Optimal. Leaf size=39 \[ x \left (a^2-b^2\right )-\frac{2 a b \log (\cos (c+d x))}{d}+\frac{b^2 \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0182302, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3477, 3475} \[ x \left (a^2-b^2\right )-\frac{2 a b \log (\cos (c+d x))}{d}+\frac{b^2 \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3477
Rule 3475
Rubi steps
\begin{align*} \int (a+b \tan (c+d x))^2 \, dx &=\left (a^2-b^2\right ) x+\frac{b^2 \tan (c+d x)}{d}+(2 a b) \int \tan (c+d x) \, dx\\ &=\left (a^2-b^2\right ) x-\frac{2 a b \log (\cos (c+d x))}{d}+\frac{b^2 \tan (c+d x)}{d}\\ \end{align*}
Mathematica [C] time = 0.103953, size = 69, normalized size = 1.77 \[ \frac{2 b^2 \tan (c+d x)-i \left ((a+i b)^2 \log (-\tan (c+d x)+i)-(a-i b)^2 \log (\tan (c+d x)+i)\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.003, size = 61, normalized size = 1.6 \begin{align*}{\frac{ab\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{d}}+{\frac{{a}^{2}\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}}-{\frac{\arctan \left ( \tan \left ( dx+c \right ) \right ){b}^{2}}{d}}+{\frac{{b}^{2}\tan \left ( dx+c \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.67447, size = 55, normalized size = 1.41 \begin{align*} a^{2} x - \frac{{\left (d x + c - \tan \left (d x + c\right )\right )} b^{2}}{d} + \frac{2 \, a b \log \left (\sec \left (d x + c\right )\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.71464, size = 100, normalized size = 2.56 \begin{align*} \frac{{\left (a^{2} - b^{2}\right )} d x - a b \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right ) + b^{2} \tan \left (d x + c\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.207715, size = 48, normalized size = 1.23 \begin{align*} \begin{cases} a^{2} x + \frac{a b \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} - b^{2} x + \frac{b^{2} \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a + b \tan{\left (c \right )}\right )^{2} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.35357, size = 271, normalized size = 6.95 \begin{align*} \frac{a^{2} d x \tan \left (d x\right ) \tan \left (c\right ) - b^{2} d x \tan \left (d x\right ) \tan \left (c\right ) - a b \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) - a^{2} d x + b^{2} d x + a b \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) - b^{2} \tan \left (d x\right ) - b^{2} \tan \left (c\right )}{d \tan \left (d x\right ) \tan \left (c\right ) - d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]